import { DictForm } from "@/api/dict/types";
import { getDictOptions } from "@/api/dict";

export default function useDictionary() {
  // 取值
  const getData = (code: string) => {
    const options: Ref<DictForm[]> = ref([]);
    getDictOptions(code).then((response) => {
      const data = response.data;
      options.value = data;
    });
    return options;
  };

  return {
    getData,
  };
}
